package com.kyxx.mycommonproject.lunbotu.model;

import com.kyxx.mycommonproject.R;
import com.kyxx.mycommonproject.lunbotu.model.bean.CarouselfigureBean;
import com.kyxx.mycommonproject.lunbotu.model.bean.ItemBean;
import com.kyxx.mycommonproject.lunbotu.model.callBack.CarouselfigureListener;
import com.kyxx.mycommonproject.lunbotu.model.impl.CarouselfigureImpl;

import java.util.ArrayList;
import java.util.List;

import static com.kyxx.mycommonproject.lunbotu.model.bean.CarouselfigureBean.*;

/**
 * Created by Administrator on 2016/9/8.
 */
public class CarouselfigureModel implements CarouselfigureImpl{
    @Override
    public void request(String url, CarouselfigureListener listener) {
        int[] ResIds = new int[] {
                R.drawable.a,
                R.drawable.b,
                R.drawable.c,
                R.drawable.d,
                R.drawable.e,
        };

        int[] TextIds = new int[] {
                R.string.a_name,
                R.string.b_name,
                R.string.c_name,
                R.string.d_name,
                R.string.e_name,
        };
        List<ItemBean> list = new ArrayList<>();
       for(int i = 0 ;i<ResIds.length;i ++){
           ItemBean bean = new ItemBean();
           bean.setPic(ResIds[i]);
           bean.setInfo(TextIds[i]);
           list.add(bean);
       }
        CarouselfigureBean carouselfigureBean = new CarouselfigureBean();
        carouselfigureBean.setBean(list);
        listener.onSuccess(carouselfigureBean);
    }
}
